
import 'package:flutter_demo/app/app.widget.dart';
import 'package:flutter_demo/routes/app.routes.dart';
import 'package:flutter_demo/routes/auth.routes.dart';
import 'package:flutter_demo/services/http.service.dart';
import 'package:fluro/fluro.dart';

class App {
  static String environment;
  static Router router;
  static HttpService http;

  App({
    String environment,
    String baseUri
  }) {
    App.environment = environment;

    App.http = new HttpService(
        baseUri: baseUri
    );

    final Router router = new Router ();
    App.router = this.initializeRoutes (router);

  }

  Router initializeRoutes(Router router) {
    new AppRoutes(router);
    new AuthRoutes(router);

    return router;
  }

  // App run.
  void run(runApp) {
    runApp(
        new AppWidget()
    );
  }
}